package ua.eug.tst2;

import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.Pixmap;
import com.badlogic.gdx.graphics.Pixmap.Format;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.scenes.scene2d.Group;
import com.badlogic.gdx.scenes.scene2d.Touchable;

public class Toolbox extends Group {
	private Texture texture;
	
	public Toolbox () {
		
		this.setName("Toolbox");
		
		//this.setTouchable(Touchable.enabled);
		
		// Generate a 1x1 white texture and store it in the skin named "white".
		Pixmap pixmap = new Pixmap(1, 1, Format.RGBA8888);
		pixmap.setColor(Color.WHITE);
		pixmap.fill();
		texture = new Texture(pixmap);
		this.setSize(70, 140);
		
		ChipTool chipActor1 = new ChipTool(new Chip(ChipType.CHIP_AND));
		chipActor1.setPosition(3, 3);
		ChipTool chipActor2 = new ChipTool(new Chip(ChipType.CHIP_RS));
		chipActor1.setPosition(3, 68);
		this.addActor(chipActor1);
		this.addActor(chipActor2);
		
	}
	
    @Override
    public void draw(Batch batch, float alpha){
        batch.draw(texture,this.getX(),this.getY(), this.getWidth(), this.getHeight());
        drawChildren(batch, alpha);
    }
	
}
